import type { FilePlugin } from "./types"


const plugins: FilePlugin[] = []

export const registerPlugin = (plugin: FilePlugin) => {
  plugins.push(plugin)
}

export const getPluginsForFile = (fileName: string) => {
  return plugins.find((p) =>
    p.fileTypes.some((ext) => fileName.endsWith(ext))
  )
}

export const getAllPlugins = () => plugins.slice()
